package tech.aistar.corejava.day10.exception;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * @author success
 * @version 1.0
 * @description:本类用来演示:异常的消极处理
 * @date 2019/7/26 0026
 */
public class NegativeHandlerDemo {
    public static void main(String[] args) {
        //异常不允许抛给main - 等同于抛给了JVM

        //记住:方法的最终的调用,一定要必须处理[积极]一下
        try {
            test01();
        } catch (ParseException e) {
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static void test01() throws ParseException, FileNotFoundException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        sdf.parse("2010/09/09");

        InputStream in = new FileInputStream("d:/success.txt");
    }
}
